#pragma once
#include <map>
#include <string>
#include "gl3w.h"

enum GLSLShaderType
{
    VERTEX = GL_VERTEX_SHADER,
    FRAGMENT = GL_FRAGMENT_SHADER,
    GEOMETRY = GL_GEOMETRY_SHADER,
    TESS_CONTROL = GL_TESS_CONTROL_SHADER,
    TESS_EVALUATION = GL_TESS_EVALUATION_SHADER,
    COMPUTE = GL_COMPUTE_SHADER
};

class GLSLProgram
{
public:
	GLSLProgram();
    bool compileShader(const char* file,GLSLShaderType ShaderType);
    bool link();
    bool use();

    void setUniform(const char *name, float x, float y, float z);
    void setUniform4f(const char *name,const float* data);
    void setUniform(const char *name, float val);
    void setUniform3x3(const char *name,const GLfloat* data);
    void setUniform4x4(const char *name,const GLfloat* data);
private:
    int getUniformLocation(const char* name);
private:
	GLuint programHandle;
	bool linked;
	std::map<std::string, int> uniformLocations;
};
